package yto.freemarker.springaop.servlet;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

/**
 * @author dongxing
 **/
public class SpringApplication {


    /**
     * tomcat的启动
     * @throws LifecycleException
     */
    public static void run() throws LifecycleException {
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(9898);
        //添加了这个才会认为是web项目
        tomcat.addWebapp("/", "d:\\z1\\");
//        tomcat.addContext("/", "d:\\z1\\");
        tomcat.start();
        tomcat.getServer().await();
    }
}
